# 单分支if语句
# score = eval(input('请输入成绩分数：'))
# if score >= 60:
#     print("成绩已及格")
# 
# if语句判断多个条件
# score = eval(input('请输入成绩分数：'))
# if score < 60:
#     print("成绩不及格")
# if 60 <= score < 80:
#     print("成绩一般")
# if 80 <= score <= 90:
#     print("成绩良好")
# if 90 < score <= 100:
#     print("成绩优秀")
# 
# if语句嵌套使用
# score = eval(input("请输入成绩分数："))
# if 60 >= score:
#     print("成绩合格")
#     if 90 <= score <=100:
#         print("成绩良好")
# 
# 双分支if-else
# a = 30
# if a > 20:
#     print("变量a大于20")
# else:
#     print("变量a不大于20")
# # 
# if语句中嵌套if-else
# score = eval(input("请输入成绩分数："))
# if score >= 60:
#     print("成绩合格")
#     if score >= 90:
#         print("成绩良好")
#     else:
#         print("成绩一般")
# 
# if-else语句中嵌套if-else
# score = eval(input("请输入成绩分数："))
# if score >= 60:
#     print("成绩合格")
#     if score >= 90:
#         print("成绩良好")
#     else:
#         print("成绩一般")
# else:
#         print("成绩不及格")
#     if score < 30:
#         print("成绩极差")
#     else:
#         print("成绩较差")
# 
# 多分支结构if-elif-else
# score = eval(input("请输入成绩分数："))
# if score >= 90:
#     print("成绩优秀")
# elif score >= 80:
#     print("成绩良好")
# elif score >= 70:
#     print("成绩中等")
# elif score >= 60:
#     print("成绩较好")
# else:
#     print("成绩不及格")
# 
# 闰年判断
# score = eval(input("请输入:"))
# if score % 4 == 0 and score % 100 != 0 or score % 400 == 0:
#     print("是闰年")
# else:
#     print("不是闰年")
# 
# while中嵌入while进行表示
# a = 1
# while a <= 100:
#     print('今天是第%d天' % a)
#     a = a + 1
# 
# 内循环
# n = 1
# sum = 0
# while n <= 10000:
#     sum = sum + n
#     n = n + 1
#     #print(sum)
# print(sum)
# 
# 嵌入for
# for t in ['9','10','11','12','13']:
#     print('时间段:',t)
# 
# for生成range
# for i in range(1,11):
#     print(i,end=" ")
#     print()
# for i in range(1,11,2):
#     print(i,end=" ")
#     print()
# for i in range(2,11,2):
#     print(i,end=" ")
# 
# 例子
# for i in range(1,101):
#     sum = sum + n
#     i = i + 1
# print(sum)
# 
# qiawhile中嵌入while
# i = 1
# while i <= 5:
#     print("上班星期为：",i)
#     i = i+1
#     t = 9
#     while t <= 17:
#         print("时间段:",t,end=" ")
#         t = t+1
#     print()
#
# range
# for i in range(1,6):
#     print('上班为周:',i)
#     for t in range(9, 8):
#         print('时间段:',t,end=" ")
#     print()
#
# while循环九九乘法表
# i = 1
# while i < 10:
#     j = 1
#     while j <= i:
#         print('%d*%d = %d'%(j,i,j*i),end = ' ')
#         j+= 1
#     print("")
#     i+= 1
#
# for九九乘法表
# for i in range(1,10):
#     for j in range(1,i+1):
#         print("%d*%d = %d"%(j,i,j*i),end=' ')
#         j += 1
#     print("")
#     i += 1
#
# while中嵌入for
# for i in range(1,10):
#     for i in range(i,i+1):
#         print('%d*%d = %d'% (j, i, j * i), end=' ')
#     print()
#
# while 中使用break跳出循环
# i = 0
# while i <= 5:
#     i += 1
#     print('星期为:',i)
#     if i == 3:
#         break
#
# i = 0
# while i <= 5:
#     if i == 3:
#         break
#     print('星期为:',i)
#     i += 1
#
# for循环中使用break语句
# for i in range(1,6):
#     print("星期",i)
#     if i == 3:
#         break
#
# for i in range(1,6):
#     if i == 3:
#         break
#     print("星期", i)
# 
# while循环中使用continue语句
# i = 0
# while i < 5:
#     i = i + 1
#     if i == 4:
#         continue
#     print("星期", i)
# 
# # for循环中使用continue语句
# for i in range(1,6):
#     if i == 4:
#         continue
#     print("星期", i)
# while循环实现斐波那契数列
# i = 3
# f1 = 1
# f2 = 1
# f3 = 1
# m = 50
# while i <= m:
#     f3 = f1 + f2
#     f1 = f2
#     f2 = f3
#     print("第%d项为%d"%(i,f2))
#     i += 1
# for循环实现斐波那契数列
# f1 = 1
# f2 = 1
# f3 = 1
# m = 50
# for i in range(3,m+1):
#     f3 = f1 + f2
#     f1 = f2
#     f2 = f3
#     print("第%d项为%d" % (i, f3))